<template>
	<view class="work_order_container">
		<view class="mail_two">
			<u-tabs class="first_tabs" :list="list" :is-scroll="false" :current="current" :show-bar="false"
				inactive-color="#e3e3e3" active-color="#ffffff" bg-color="#cccccc" @change="change"></u-tabs>
			<!-- 报事报修 -->
			<view class="tabs" v-if="current==0">
				<uni-card class="unique" style="height: 82rpx; margin: 0; border-radius: unset;">
					<u-tabs :list="list2" :current="current2" item-width="150rpx" bar-width="90" :gutter="10" @change="change2"
						style="color: red;">
					</u-tabs>
				</uni-card>
			</view>
			<!-- 抄表 -->
<!-- 			<view class="tabs" v-if="current==1">
				<uni-card class="unique" style="height: 82rpx; margin: 0; border-radius: unset;">
					<u-tabs :list="list3" :current="current4" item-width="150rpx" bar-width="90" :gutter="10" @change="change4">
					</u-tabs>
				</uni-card>
			</view> -->
		</view>
		<view class="" style="position: fixed; z-index: 99;width: 100%;height: 20rpx;background: linear-gradient(to right, #e8f5ff , #effcff);">
		
		</view>

		<!-- 报事报修 -->
		<view v-if="current==0" style="margin-top: 20rpx;">
			<!-- 全部 -->
			<uni-card class="second_card three_card" v-for="(value,key,index) in allData2" :key="index" style="margin: 0;" v-if="current2==0">
				<view class="time">
					{{ key }}
				</view>
				<u-cell-group :border="false" v-for="(item,index) in allData2[key]" :key="index">
					<u-cell-item title="园区报修" arrow-direction="right" @click="repairAll" v-if="item.repairType==0">
						<u-cell-item :arrow="false" :border-bottom="false" :title="item.description" :value="item.auditFlag=='0'? '待审核' : item.auditFlag=='1' ? '同意' : '拒绝'">
						</u-cell-item>
					</u-cell-item>
					<u-cell-item title="居家维修" arrow-direction="right" @click="repairAll" v-if="item.repairType==1">
						<u-cell-item :arrow="false" :border-bottom="false" :title="item.description" :value="item.auditFlag=='0'? '待审核' : item.auditFlag=='1' ? '同意' : '拒绝'">
						</u-cell-item>
					</u-cell-item>
					<u-cell-item title="灾害报事" arrow-direction="right" @click="repairAll" v-if="item.repairType==2">
						<u-cell-item :arrow="false" :border-bottom="false" :title="item.description" :value="item.auditFlag=='0'? '待审核' : item.auditFlag=='1' ? '同意' : '拒绝'">
						</u-cell-item>
					</u-cell-item>
					<u-cell-item title="投诉" arrow-direction="right" @click="repairAll" v-if="item.repairType==3">
						<u-cell-item :arrow="false" :border-bottom="false" :title="item.description" :value="item.auditFlag=='0'? '待审核' : item.auditFlag=='1' ? '同意' : '拒绝'">
						</u-cell-item>
					</u-cell-item>
					<u-cell-item title="建议" arrow-direction="right" @click="repairAll" v-if="item.repairType==4">
						<u-cell-item :arrow="false" :border-bottom="false" :title="item.description" :value="item.auditFlag=='0'? '待审核' : item.auditFlag=='1' ? '同意' : '拒绝'">
						</u-cell-item>
					</u-cell-item>
				</u-cell-group>
			</uni-card>

			<!-- 待接单 -->
			<uni-card class="second_card three_card" v-for="(value,key,index) in allData4" :key="index" style="margin: 0;" v-if="current2==1">
				<view class="time">
					{{ key }}
				</view>
				<u-cell-group :border="false" v-for="(item,index) in allData4[key]" :key="index">
					<u-cell-item title=" " arrow-direction="right" @click="reportWhole(item.orderId)" v-if="item.executeStatus==0">
						<u-cell-item :arrow="false" :border-bottom="false" :title="item.describe" value="待接单">
						</u-cell-item>
					</u-cell-item>
					<u-cell-item title=" " arrow-direction="right" @click="reportWhole(item.orderId)" v-if="item.executeStatus==1">
						<u-cell-item :arrow="false" :border-bottom="false" :title="item.describe" value="待复查">
						</u-cell-item>
					</u-cell-item>
					<u-cell-item title=" " arrow-direction="right" @click="reportWhole(item.orderId)" v-if="item.executeStatus==2">
						<u-cell-item :arrow="false" :border-bottom="false" :title="item.describe" value="已复查">
						</u-cell-item>
					</u-cell-item>
					<u-cell-item title=" " arrow-direction="right" @click="reportWhole(item.orderId)" v-if="item.executeStatus==3">
						<u-cell-item :arrow="false" :border-bottom="false" :title="item.describe" value="未评价">
						</u-cell-item>
					</u-cell-item>
					<u-cell-item title=" " arrow-direction="right" @click="reportWhole(item.orderId)" v-if="item.executeStatus==4">
						<u-cell-item :arrow="false" :border-bottom="false" :title="item.describe" value="未完成">
						</u-cell-item>
					</u-cell-item>
				</u-cell-group>
			</uni-card>
			<!-- 待执行 -->
			<uni-card class="second_card three_card" v-for="(value,key,index) in allData5" :key="index" style="margin: 0;" v-if="current2==2">
				<view class="time">
					{{ key }}
				</view>
				<u-cell-group :border="false" v-for="(item,index) in allData5[key]" :key="index">
					<u-cell-item title=" " arrow-direction="right" @click="reportImplemented(item.orderId)" v-if="item.executeStatus==0">
						<u-cell-item :arrow="false" :border-bottom="false" :title="item.describe" value="未执行">
						</u-cell-item>
					</u-cell-item>
					<u-cell-item title=" " arrow-direction="right" @click="reportImplemented(item.orderId)" v-if="item.executeStatus==1">
						<u-cell-item :arrow="false" :border-bottom="false" :title="item.describe" value="正常执行">
						</u-cell-item>
					</u-cell-item>
					<u-cell-item title=" " arrow-direction="right" @click="reportImplemented(item.orderId)" v-if="item.executeStatus==2">
						<u-cell-item :arrow="false" :border-bottom="false" :title="item.describe" value="超时执行">
						</u-cell-item>
					</u-cell-item>
				</u-cell-group>
			</uni-card>
			<!-- 待复查 -->
			<uni-card class="second_card three_card" v-for="(value,key,index) in allData6" :key="index" style="margin: 0;" v-if="current2==3">
				<view class="time">
					{{ key }}
				</view>
				<u-cell-group :border="false" v-for="(item,index) in allData6[key]" :key="index">
					<u-cell-item title=" " arrow-direction="right" @click="reportReviewed(item.orderId)" v-if="item.executeStatus==1">
						<u-cell-item :arrow="false" :border-bottom="false" :title="item.describe" value="待复查">
						</u-cell-item>
					</u-cell-item>
				</u-cell-group>
			</uni-card>
			<!-- 评价 -->
			<uni-card class="second_card three_card" v-for="(value,key,index) in allData24" :key="index" style="margin: 0;" v-if="current2==4">
				<view class="time">
					{{key}}
				</view>
				<u-cell-group :border="false"  v-for="(item,index) in allData24[key]" :key="index">
					<u-cell-item title=" " arrow-direction="right" @click="evaluate(item.orderId)"
						v-if="item.assessStatus==0">
						<u-cell-item :arrow="false" :border-bottom="false" :title="item.describe" value="未评价">
						</u-cell-item>
					</u-cell-item>
					<u-cell-item title=" " arrow-direction="right" @click="evaluate(item.orderId)"
						v-if="item.assessStatus==1">
						<u-cell-item :arrow="false" :border-bottom="false" :title="item.describe" value="已评价">
						</u-cell-item>
					</u-cell-item>
				</u-cell-group>
			</uni-card>

		</view>
		<!-- 抄表 -->
		<!-- <view v-if="current==1" style="margin-top: 20rpx;"> -->
			<!-- 全部 -->
<!-- 			<uni-card class="second_card" style="margin: 0;" v-if="current4==0">
				<view class="time">
					2021-06-09 星期三 今天
				</view>
				<u-cell-group :border="false">
					<u-cell-item title="抄表" arrow-direction="right" @click="reportReading">
						<u-cell-item :arrow="false" :border-bottom="false" title="Y1#-2#单元总水表" value="待发单">
						</u-cell-item>
					</u-cell-item>
					<u-cell-item title="抄表" arrow-direction="right" @click="readingWhole">
						<u-cell-item :arrow="false" :border-bottom="false" title="Y1#-2#单元总水表" value="待发单">
						</u-cell-item>
					</u-cell-item>
				</u-cell-group>
			</uni-card> -->
			<!-- 待接单 -->
<!-- 			<uni-card class="second_card" style="margin: 0;" v-if="current4==1">
				<view class="time">
					2021-06-09 星期三 今天
				</view>
				<u-cell-group :border="false">
					<u-cell-item title="抄表" arrow-direction="right" @click="reportReading">
						<u-cell-item :arrow="false" :border-bottom="false" title="Y1#-2#单元总水表" value="待发单">
						</u-cell-item>
					</u-cell-item>
				</u-cell-group>
			</uni-card> -->
			<!-- 待执行 -->
<!-- 			<uni-card class="second_card" style="margin: 0;" v-if="current4==2">
				<view class="time">
					2021-06-09 星期三 今天
				</view>
				<u-cell-group :border="false">
					<u-cell-item title="抄表" arrow-direction="right" @click="repairImplemented">
						<u-cell-item :arrow="false" :border-bottom="false" title="Y1#-2#单元总水表" value="待发单">
						</u-cell-item>
					</u-cell-item>
				</u-cell-group>
			</uni-card> -->
			<!-- 待复查 -->
<!-- 			<uni-card class="second_card" style="margin: 0;" v-if="current4==3">
				<view class="time">
					2021-06-09 星期三 今天
				</view>
				<u-cell-group :border="false">
					<u-cell-item title="抄表" arrow-direction="right" @click="repairReviewed">
						<u-cell-item :arrow="false" :border-bottom="false" title="Y1#-2#单元总水表" value="待发单">
						</u-cell-item>
					</u-cell-item>
				</u-cell-group>
			</uni-card> -->
			<!-- 完成 -->
<!-- 			<uni-card class="second_card" style="margin: 0;" v-if="current4==4">
				<view class="time">
					2021-06-09 星期三 今天
				</view>
				<u-cell-group :border="false">
					<u-cell-item title="抄表" arrow-direction="right" @click="repairComplete">
						<u-cell-item :arrow="false" :border-bottom="false" title="Y1#-2#单元总水表" value="待发单">
						</u-cell-item>
					</u-cell-item>
				</u-cell-group>
			</uni-card>
		</view> -->
<!-- 		<view class="icon_one">
			<u-icon name="plus-circle" size="120" @click="newworkOrder"></u-icon>
		</view> -->
		<!-- template部分，u-tabBar放在页面展现最后 -->
		<!-- <u-tabbar :list="tabBarList" :active-color="activeColor" :inactive-colot="inactiveColor"></u-tabbar> -->
		<!-- tabBar -->
		<tabBar v-if="flag"></tabBar>
	</view>
</template>

<script>
	import tabBar from "@/components/tabBar/tabBar.vue"
	import {
		mapGetters
	} from 'vuex'
	export default {
		components:{
			tabBar
		},
		props:["allData2","allData4","allData24","allData6","allData5"],
		data() {
			return {
				list: [{
					name: '报事报修'
				}],
				list2: [{
					name: '全部'
				}, {
					name: '待接单',
				}, {
					name: '待执行',
				}, {
					name: '待复查',
				}, {
					name: '评价',
				}],
				list3: [{
					name: '全部'
				}, {
					name: '待接单',
				}, {
					name: '待执行',
				}, {
					name: '待复查',
				}, {
					name: '完成',
				}],
				// list4: [{
				// 	name: '全部'
				// }, {
				// 	name: '待接单',
				// }, {
				// 	name: '待执行',
				// }, {
				// 	name: '待复查',
				// }, {
				// 	name: '完成',
				// }],
				// list5: [{
				// 	name: '待审批'
				// }, {
				// 	name: '已审批',
				// }],
				current: 0,
				current2: 0,
				current3: 0,
				current4: 0,
				current5: 0,
				activeColor: "#55a0ff", // 选中时的颜色
				inactiveColor: "#000", // 未选中时的颜色
				user_type: '',
				// 报事报修待执行列表
				flag:''
			}
		},
		computed: {
			...mapGetters([
				'tabBarList', // 获取展示的tabBar列表
			])
		},
		onLoad() {
			// this.getcoursetype()
			this.executed()
		},
		onShow() {
			// 报事报修待执行列表
			// this.executed()
			this.flag = true
		},
		onHide() {
			this.flag = false
			// console.log('onHide')
		},
		methods: {
			// 报事报修待执行列表
			// executed() {
			// 	console.log(111)
			// 	// this.$http.get('WorkOrder/selectToBeExecuteds',{}).then(res => {
			// 	// 	this.allData16=res.data
			// 	// 	// this.tempDate=res.data
			// 	// 	let areaId=res.data
			// 	// 	console.log(areaId, '报事报修待执行列表')
			// 	// })
			// },
			change(index) {
				this.current = index;
				console.log(this.current)
			},
			change2(index) {
				this.current2 = index;
				// console.log(this.current2)
			},
			change3(index) {
				this.current3 = index;
				// console.log(this.current2)
			},
			change4(index) {
				this.current4 = index;
				// console.log(this.current2)
			},
			change5(index) {
				this.current5 = index;
				// console.log(this.current2)
			},
			getcoursetype() { //课程分类
				this.$http.get('common/getImgCaptcha',{}).then(res => {
					console.log(res, '课程分类')
					uni.setStorageSync('userType', res.code);
					this.user_type = uni.getStorageSync("userType")
				})
			},
			// 报事报修全部
			repairAll() {
				// this.openUrl('/pagesB/workRepair/reportWhole/reportWhole')
			},
			// 报事报修待接单
			reportWhole(orderId) {
				this.openUrl(`/pagesB/workRepair/reportWhole/reportWhole?orderId=${orderId}`)
			},
			// 报事报修待执行
			reportImplemented(orderId) {
				this.openUrl(`/pagesB/workRepair/reportImplemented/reportImplemented?orderId=${orderId}`)
			},
			// 报事报修待复查
			reportReviewed(orderId) {
				this.openUrl(`/pagesB/workRepair/reportReviewed/reportReviewed?orderId=${orderId}`)
			},
			// 评价详情
			evaluate(orderId) {
				this.openUrl(`/pagesA/workOrder/evaluate/evaluate?orderId=${orderId}`)
			},
			// 抄表全部第一行
			reportReading() {
				this.openUrl('/pagesB/workRepair/reportReading/reportReading')
			},
			// 抄表全部第二行
			readingWhole() {
				this.openUrl('/pagesB/workRepair/readingWhole/readingWhole')
			},
			workInformation() {
				this.openUrl('/pagesB/workRepair/workInformation/workInformation')
			},
			// 抄表待执行
			repairImplemented() {
				this.openUrl('/pagesB/workRepair/repairImplemented/repairImplemented')
			},
			// 抄表待复查
			repairReviewed() {
				console.log(111)
				this.openUrl('/pagesB/workRepair/repairReviewed/repairReviewed')
			},
			// 抄表完成
			repairComplete() {
				this.openUrl('/pagesB/workRepair/repairComplete/repairComplete')
			}
		}
	}
</script>

<style lang="scss" scoped>
	/deep/.uni-card__content {
		color: red;
		padding: 0;
	}

	.mail_two {
		overflow: hidden;
		width: 100%;
		height: 308rpx;
		background-color: #cccccc;

		::v-deep .first_tabs {
			position: fixed;
			width: 100%;
			z-index: 9;
			display: block;
			// margin-left: 33rpx !important;
			// margin-top: 150rpx !important;
			/deep/.u-tabs {
				height: 200rpx !important;
				background: linear-gradient(-99.24deg, #57E1FF 0%, #75F7FF 20%, #0D92FF 100%) !important;
				padding: 100rpx 0 0 33rpx;
			}

			.u-tab-item:nth-child(3) {
				// flex: unset !important;
			}

			.u-tab-item:nth-child(5) {
				flex: unset !important;
			}

		}

		.tabs {

			// /deep/.uni-card__content {
			// 	padding: 0;
			// }
			position: fixed;
			width: 100%;
			z-index: 99;
			margin-top: 223rpx;
			/deep/.uni-card__content--pd.data-v-19622063 {
				padding: 0;
			}
		}
	}

	/deep/.second_card {
		.time {
    margin: 42rpx 0 8rpx 0;
			text-align: center;
			color: #ccc;
		}

		/deep/.u-cell__value {
			margin-right: -18rpx;
		}

		.u-cell {
			padding: 12rpx 32rpx;
		}

		.uni-card__content {
			padding: 0 24rpx !important;
		}
	}

	.icon_one {
		// position: absolute;
		// top: 1000rpx;
		// right: 10rpx;
		z-index: 999;
	}

	/deep/.uni-border {
		border-radius: unset !important;
		margin: 24rpx 0 !important;
	}

	.uni-border[data-v-19622063]:after {
		border: unset;
	}

	/deep/.uni-border.data-v-19622063:after {
		border: unset;
	}
</style>
